#include "Handle.h"

using namespace std;


Handle::Handle(HANDLE handle) 
: mHandleHolder(shared_ptr<HandleHolder>(new HandleHolder(handle)))
{}

HANDLE Handle::getHandle() { return mHandleHolder->mHandle;}


Handle::operator HANDLE() {
	return mHandleHolder->mHandle;
}

// The HandleHolder OWNS the underlying handle. After the HandleHolder is destroyed the Handle will be closed.
/*	struct Handle::HandleHolder {
	HandleHolder(HANDLE handle) : mHandle(handle) {}
	~HandleHolder() { CloseHandle(mHandle);}
	HANDLE mHandle;
};*/

